function getQueryString(name: any) {
  let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i')
  const search = window.location.href.substr(window.location.href.indexOf('?'))
  let r = search.substr(1).match(reg)

  if (r != null) {
    return unescape(r[2])
  }
  return null
}

function getModelCheck () {
  const { availHeight, availWidth } = window.screen
  if (window.navigator.userAgent.match(/iphone/i)) {
    return [
      '375-812',
      '414-896'
    ].includes(`${availWidth}-${availHeight}`)
  }
}

export { getQueryString, getModelCheck }
